home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / plumber_2.swf / scripts / frame_57 / DoAction.as
Text File  |  2011-01-13  |  4KB  |  254 lines

  1. pipedir = eval("pipe" + pipen).pipe.dir;
  2. pipetype = holder[pipen];
  3. error = 1;
  4. if(flow == 1)
  5. {
  6.    if(pipetype == 1)
  7.    {
  8.       if(pipedir == 3)
  9.       {
  10.          correct++;
  11.          flow = 2;
  12.          error = 0;
  13.          thatsright();
  14.          x++;
  15.       }
  16.       else if(pipedir == 4)
  17.       {
  18.          correct++;
  19.          flow = 4;
  20.          error = 0;
  21.          thatsright();
  22.          x--;
  23.       }
  24.    }
  25.    if(pipetype == 2)
  26.    {
  27.       if(pipedir == 2 || pipedir == 4)
  28.       {
  29.          correct++;
  30.          flow = 1;
  31.          error = 0;
  32.          thatsright();
  33.          y--;
  34.       }
  35.    }
  36.    if(pipetype == 3)
  37.    {
  38.       if(pipedir == 1 || pipedir == 3)
  39.       {
  40.          correct++;
  41.          flow = 2;
  42.          error = 0;
  43.          thatsright();
  44.          x++;
  45.       }
  46.       else if(pipedir == 2 || pipedir == 4)
  47.       {
  48.          correct++;
  49.          flow = 4;
  50.          error = 0;
  51.          thatsright();
  52.          x--;
  53.       }
  54.    }
  55.    if(pipetype == 4)
  56.    {
  57.       correct++;
  58.       flow = 1;
  59.       error = 0;
  60.       thatsright();
  61.       y--;
  62.    }
  63. }
  64. else if(flow == 2)
  65. {
  66.    if(pipetype == 1)
  67.    {
  68.       if(pipedir == 1)
  69.       {
  70.          correct++;
  71.          flow = 1;
  72.          error = 0;
  73.          thatsright();
  74.          y--;
  75.       }
  76.       else if(pipedir == 4)
  77.       {
  78.          correct++;
  79.          flow = 3;
  80.          error = 0;
  81.          thatsright();
  82.          y++;
  83.       }
  84.    }
  85.    if(pipetype == 2)
  86.    {
  87.       if(pipedir == 1 || pipedir == 3)
  88.       {
  89.          correct++;
  90.          flow = 2;
  91.          error = 0;
  92.          thatsright();
  93.          x++;
  94.       }
  95.    }
  96.    if(pipetype == 3)
  97.    {
  98.       if(pipedir == 1 || pipedir == 3)
  99.       {
  100.          correct++;
  101.          flow = 1;
  102.          error = 0;
  103.          thatsright();
  104.          y--;
  105.       }
  106.       else if(pipedir == 2 || pipedir == 4)
  107.       {
  108.          correct++;
  109.          flow = 3;
  110.          error = 0;
  111.          thatsright();
  112.          y++;
  113.       }
  114.    }
  115.    if(pipetype == 4)
  116.    {
  117.       correct++;
  118.       flow = 2;
  119.       error = 0;
  120.       thatsright();
  121.       x++;
  122.    }
  123. }
  124. else if(flow == 3)
  125. {
  126.    if(pipetype == 1)
  127.    {
  128.       if(pipedir == 1)
  129.       {
  130.          correct++;
  131.          flow = 4;
  132.          error = 0;
  133.          thatsright();
  134.          x--;
  135.       }
  136.       else if(pipedir == 2)
  137.       {
  138.          correct++;
  139.          flow = 2;
  140.          error = 0;
  141.          thatsright();
  142.          x++;
  143.       }
  144.    }
  145.    if(pipetype == 2)
  146.    {
  147.       if(pipedir == 2 || pipedir == 4)
  148.       {
  149.          correct++;
  150.          flow = 3;
  151.          error = 0;
  152.          thatsright();
  153.          y++;
  154.       }
  155.    }
  156.    if(pipetype == 3)
  157.    {
  158.       if(pipedir == 1 || pipedir == 3)
  159.       {
  160.          correct++;
  161.          flow = 4;
  162.          error = 0;
  163.          thatsright();
  164.          x--;
  165.       }
  166.       else if(pipedir == 2 || pipedir == 4)
  167.       {
  168.          correct++;
  169.          flow = 2;
  170.          error = 0;
  171.          thatsright();
  172.          x++;
  173.       }
  174.    }
  175.    if(pipetype == 4)
  176.    {
  177.       correct++;
  178.       flow = 3;
  179.       error = 0;
  180.       thatsright();
  181.       y++;
  182.    }
  183. }
  184. else if(flow == 4)
  185. {
  186.    if(pipetype == 1)
  187.    {
  188.       if(pipedir == 2)
  189.       {
  190.          correct++;
  191.          flow = 1;
  192.          error = 0;
  193.          thatsright();
  194.          y--;
  195.       }
  196.       else if(pipedir == 3)
  197.       {
  198.          correct++;
  199.          flow = 3;
  200.          error = 0;
  201.          thatsright();
  202.          y++;
  203.       }
  204.    }
  205.    if(pipetype == 2)
  206.    {
  207.       if(pipedir == 1 || pipedir == 3)
  208.       {
  209.          correct++;
  210.          flow = 4;
  211.          error = 0;
  212.          thatsright();
  213.          x--;
  214.       }
  215.    }
  216.    if(pipetype == 3)
  217.    {
  218.       if(pipedir == 1 || pipedir == 3)
  219.       {
  220.          correct++;
  221.          flow = 3;
  222.          error = 0;
  223.          thatsright();
  224.          y++;
  225.       }
  226.       else if(pipedir == 2 || pipedir == 4)
  227.       {
  228.          correct++;
  229.          flow = 1;
  230.          error = 0;
  231.          thatsright();
  232.          y--;
  233.       }
  234.    }
  235.    if(pipetype == 4)
  236.    {
  237.       correct++;
  238.       flow = 4;
  239.       error = 0;
  240.       thatsright();
  241.       x--;
  242.    }
  243. }
  244. if(pipetype == 5)
  245. {
  246.    error = 0;
  247.    gotoAndStop("yay");
  248.    play();
  249. }
  250. if(error > 0)
  251. {
  252.    gotoAndPlay(66);
  253. }
  254.